/**
 * 车辆管理Api
 * @author 方礼爱
 * @version 1.0.0
 */
import request from '@/utils/request'
/**
 * 获取所有的车辆信息
 * @param {查询参数} search
 */
export const getCarByPage = (search = {}) => {
  return request.fetchGet('/cys/car/list/page', search)
}

export const getCarByList = (search = {}) => {
  return request.fetchGet('/cys/car/list', search)
}

export  const  editCar = (car) => {
   return request.fetchPost("/cys/car/doAddOrEditCar",car)
}

export const getCarDeviceInfo = (no) => {
  return request.fetchGet("/cys/car/getCarDeviceInfo",{deviceNumber:no})
}
export const doExamineCar = (carId, status) => {
  var params = {
    carid: carId,
    status: status
  }
  return request.fetchPost('/cys/car/doExamineCar', params)
}

/**
 * 获取正常车辆
 */
export const getCarList = (params = {}) => {
  return request.fetchGet('/cys/car/showCarList', params)
}

/**
 * 獲取所有車輪不分頁
 */
export const getAllCars = () => {
  const params = {}
  params.status = 1
  params.isPage = 0
  return request.fetchGet('/cys/car/showCarList', params)
}
/**
 * 获取所有车辆类型
 */
export const getCarTypes = (search = {}) => {
  return request.fetchPost('/admin/cartype/all', search)
}

/**
 * 编辑车辆类型
 * @param {类型}} params
 */
export const add = (params) => {
  return request.fetchPost('/admin/cartype/add', params)
}
/**
 * 删除车辆类型
 * @param {类型ID}} carTypeId
 */
export const delCarType = (carTypeId) => {
  return request.fetchPost('/admin/cartype/del/' + carTypeId, {})
}

